<template>
	<view>
		<navigator class="goods-item" :url="`../../pages/goods/detail?id=${item.id}`">
			<u-image :showLoading="true" :src="item.cover_url" width="100%" height="120px" mode="aspectFit"></u-image>
			<view class="title">{{item.title}}</view>
			<view class="u-flex u-flex-between u-p-r-20 u-m-b-10">
				<view class="price">¥{{item.price}}</view>
				<view class="sales">销量：{{item.sales}}</view>
			</view>
		</navigator>
	</view>
</template>

<script>
	export default {
		name: "goodsCard",
		data() {
			return {

			};
		},
		props: {
			item: {
				type: Object,
				default () {
					return {}
				}
			}
		}
	}
</script>

<style scoped lang="scss">
	.goods-item {
		padding: 20rpx;
		box-shadow: 6rpx 12rpx 20rpx 0 rgba($color: #000000, $alpha: 0.2);
		margin: 10rpx;
	}

	.title {
		font-weight: 500;
		font-size: 32rpx;
		margin: 10rpx 0;
	}

	.price {
		color: red;
	}

	.sales {
		color: grey;
	}
</style>
